[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+---------+################################################################
#+-| COPY TO |-------------------------------------------+####################
#| +---------+ The COPY TO command copies records to the |####################
#| database file specified by <C-exp> |####################
#+-------------------------------------------------------+####################
##############################################################################
##############################################################################
#+--| Syntax |----------------------------------------------+#################
#| [!<Alias>] COPY TO <C-exp> [Scope][WHILE <L-exp> |#################
#| [FOR <L-exp>] |#################
#+----------------------------------------------------------+#################
##############################################################################
##############################################################################
#########+---| Description |----------------------------------------+#########
#########| COPY TO copies all fields in the current alias into the |#########
#########| specified database. An implied BUILD is performed using |#########
#########| the selected alias to create the new database. Use the |#########
#########| exist() function to see if the destination file exists. |#########
#########| -------------------------------------------------------- |#########
#########| COPY TO can be used to sort a database when the selected |#########
#########| alias is indexed. |#########
#########| -------------------------------------------------------- |#########
#########| The default scope of COPY TO is ALL. |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Create a "sub-database" for all Colorado entries. |#########
#########| |#########
#########| USE maindbf |#########
#########| COPY TO "colorado.dbf" FOR maindbf->st = "CO" |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * See if the destination file exists prior |#########
#########| * to the copy. |#########
#########| |#########
#########| destination = "c:\data\ngldata.dbf" |#########
#########| k = chr('y') |#########
#########| IF exists( destination ) |#########
#########| ? "Database exists. Continue with copy?[Y/N]" |#########
#########| |#########
#########| *--- get 'y' or 'n' |#########
#########| |#########
#########| REPEAT |#########
#########| k = get_key() |#########
#########| IF k >= 'A' .AND. k=< 'Z' |#########
#########| k = k - 'A' + 'a' && convert to lower case |#########
#########| ENDIF |#########
#########| UNTIL k = 'y' .OR. k = 'n' |#########
#########| ENDIF |#########
#########| IF k = 'y' |#########
#########| COPY "ngldata.dbf" TO destination |#########
#########| ENDIF |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
APPEND FROM
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson